import { LocalStorageConfig } from "../config/LocalStorageConfig";
import LocalStorage from "../engine/LocalStorage";

export class UserInfo {

    private static _instance: UserInfo;
    public static get instance(): UserInfo {
        if (!UserInfo._instance) {
            UserInfo._instance = new UserInfo();
            UserInfo._instance.init()
        }
        return UserInfo._instance;
    }

    private _language: string; //语言

    private init() {
        this._language = LocalStorage.getString(LocalStorageConfig.Language)
    }

    public set language(language: string) {
        this._language = language;
        LocalStorage.setStrig(LocalStorageConfig.Language, this._language)
    }
    public get language(): string {
        return this._language;
    }




}